<?php
if (!defined('ACCESS')) {
    exit('Access denied.');
}

class AdminOrderSn extends Base
{
    // 表名
    private static $table_name = 'yg_userinfo';
    // 查询字段
    private static $columns = array('id', 'product_id', 'order_sn', 'num', 'user_name', 'email', 'addr', 'phone', 'add_date');


    public static function getTableName()
    {
        return self::$table_name;
    }

    public static function getAll()
    {
        $db = self::__instance();
        $list = $db->select(self::getTableName(), self::$columns);
        return $list;
    }


    public static function getSnBySn($order_sn)
    {
        $db = self::__instance();
        $condition = array("order_sn" => $order_sn);
        $list = $db->get(self::getTableName(), self::$columns, $condition);
        return $list;
    }


    public static function delete($order_sn)
    {
        $db = self::__instance();
        $condition = array("order_sn" => $order_sn);
        $ret = $db->delete(self::getTableName(), $condition);
        return $ret;
    }
}